package com.xmy.cultivate.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xmy.cultivate.entity.AuditClaim;
import com.xmy.cultivate.mapper.AuditClaimMapper;
import com.xmy.cultivate.service.IAuditClaimService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 报销申请 服务实现类
 * </p>
 *
 * @author hpiggy
 * @since 2025-01-01
 */
@Service
public class AuditClaimServiceImpl extends ServiceImpl<AuditClaimMapper, AuditClaim> implements IAuditClaimService {
    @Autowired
    AuditClaimMapper auditClaimMapper;

    /**
     * 报销申请数量
     */
    @Override
    public AuditClaim getAuditClaimCount(String adminId) {
        return auditClaimMapper.getAuditClaimCount(adminId);
    }

    /**
     * 报销申请列表
     */
    @Override
    public List<AuditClaim> getAuditClaimList(IPage<AuditClaim> page, String schoolId, String name, String startDate, String endDate, String type, String status, String adminId) {
        return auditClaimMapper.getAuditClaimList(page, schoolId, name, startDate, endDate, type, status, adminId);
    }

    /**
     * 报销申请详情
     */
    @Override
    public AuditClaim getAuditClaimDetail(String id) {
        return auditClaimMapper.getAuditClaimDetail(id);
    }

    @Override
    public AuditClaim getClaimOneByIdDesc(@Param("id") Long id){
        return auditClaimMapper.getClaimOneByIdDesc(id);
    }
}
